package acwing._2LanQiao._8NumberTheory;
/**
 * @Project : AlgorithmLearning
 * @Package : ACWing._2LanQiao._8numberTheory
 * @File : Q1296.java
 * @Author : WangRuoyu
 * @Date : 2023/3/21 16:23
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Q1296 {

    static int[] primes = new int[50010];
    static int cnt = 0;
    static boolean[] st = new boolean[50010];
    static int ans[] = new int[50010];
    static int len;

    public static void getPrimes(int n) {
        for (int i = 2; i <= n; ++i) {
            if (!st[i]) primes[cnt++] = i;
            for (int j = 0; primes[j] * i <= n; ++j) {
                st[primes[j] * i] = true;
                if (i % primes[j] == 0) break;
            }
        }
    }

    static boolean is_prime(int x) {
        if (x < 50000) return !st[x];
        for (int i = 0; primes[i] <= x / primes[i]; ++i) {
            if (x % primes[i] == 0) return false;
        }
        return true;
    }

    static void dfs(int last, int prod, int s) {
        if (s == 1) {
            ans[len++] = prod;
            return;
        }
        if (s - 1 > (last < 0 ? 1 : primes[last]) && is_prime(s - 1)) {
            ans[len++] = prod * (s - 1);
        }
        for (int i = last + 1; primes[i] <= s / primes[i]; ++i) {
            int p = primes[i];
            for (int j = p + 1, t = p; j <= s; t *= p, j += t) {
                if (s % j == 0) {
                    dfs(i, prod * t, s / j);
                }
            }
        }
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        getPrimes(50000);
        String line = br.readLine();

        while (!line.equals("")) {
            int s = Integer.parseInt(line);
            len = 0;
            dfs(-1, 1, s);
            System.out.println(len);
            if (len != 0) {
                int[] res = new int[len];
                System.arraycopy(ans, 0, res, 0, res.length);
                Arrays.sort(res);
                for (int re : res) {
                    System.out.print(re + " ");
                }
                System.out.println();
            }
            line = br.readLine();
        }
    }
}